package com.test.qnews.activity;

import android.content.Intent;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.test.qnews.R;

/**
 * Created by dllo on 16/1/18.
 */
public class NetActivity extends BaseActivity{
    private WebView webView;
    @Override
    protected int setLayout() {
        return R.layout.activity_net;
    }

    @Override
    protected void initView() {
        webView = (WebView) findViewById(R.id.webView);

        Intent intent = getIntent();
        int position = intent.getIntExtra("pos",0);
        String str1 = intent.getStringExtra("" +position);
        webView.loadUrl(str1);
        WebSettings settings = webView.getSettings();
        settings.setJavaScriptEnabled(true);
        webView.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }
        });

    }
}
